<?php
error_reporting(E_ALL);
// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/application'));

// Define application environment
defined('APPLICATION_ENV')
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
    
defined('DS')
	|| define('DS', DIRECTORY_SEPARATOR);

defined('PS')
	|| define('PS', PATH_SEPARATOR);

defined('WEB_ROOT')
	|| define('WEB_ROOT', dirname(__FILE__));
defined('FDOC_ROOT_DIR')
	|| define('FDOC_ROOT_DIR', '');

// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(APPLICATION_PATH.'/modules'),
    realpath(APPLICATION_PATH.'/../library'),
    get_include_path(),
)));

require_once '/Emos/Application/Application.php';
$application = new Emos_Application_Application($options = array());

$application->setOptions($options = array('options'))
        ->bootstrap()
        ->run();
